/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import java.util.Comparator;
import java.util.Date;

/**
 *
 * @author Thai Ha Cong
 */

public class Issue implements Serializable, Comparable<Issue>{
    private Integer idIssue;
    private Date createTime;
    private Order order;
    private Staff staff;

    public Issue() {
    }
    
    public Issue(Date createTime, Order order, Staff staff)
    {
        this.createTime = createTime;
        this.order = order;
        this.staff = staff;
    }
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order1) {
        this.order = order1;
    }

    public Staff getStaff() {
        return staff;
    }

    public void setStaff(Staff staff) {
        this.staff = staff;
    }

    @Override
    public int compareTo(Issue issue) {
        int compareQuantity = ((Issue) issue).getOrder().getTotalQuantity(); 
       return this.getOrder().getTotalQuantity() - compareQuantity; //To change body of generated methods, choose Tools | Templates.
    }
 
}
